# REPLICATION ARCHIVE

This replication archive contains all scripts and data necessary to replicate the analysis in the following paper.

Title: Citizens' Preferences for Multidimensional Representation.
Authors: Jack Blumenau; Christopher Wratil; Fabio Wolkenstein
Journal: Perspectives on Politics

These replication files create figures 2, 3, 4, 5, and 6 in the published paper, as well as a host of ancillary figures and tables that are used in the supplementary materials of the paper.

## ANALYSIS

In order to re-run the analysis described in the paper, you will need to execute the file "00_run.sh". Before doing so, please open the file in the directory "code" with a text editor and CHANGE THE PARAMETER "PROJECT_DIR" IN THE SECOND LINE OF CODE TO YOUR DIRECTORY FOR THESE REPLICATION FILES. Then uncomment that line. Then save the file.

Then, to execute the file, the easiest way is to open the terminal, and run the following line of code:

	bash path_to_replication_directory/code/00_run.sh


Where "path_to_replication_directory" is the path to the replication files. run.sh creates some necessary directory structure, executes the script 00_source.R, and then compiles the final manuscript.

- 00_source.R executes the following files (in the following order):

	- 01_prep_fa.r -- prepares the data for the factor analysis
	- 02_fa_analysis.r -- conducts the factor analysis, and creates figures 3, 4, and 5
	- 03_prep_conjoint.r -- prepares the data for the conjoint analysis
	- 04_conjoint_analysis.r -- conducts the conjoint analysis, and creates figure 6
	- 05_descriptives.R -- creates some additional descriptive plots, including figure 2
	- 06_quota_checks.R -- conducts some additional checks


## DATA

- data/Measuring+Multidimensional+Representation+-+Conjoint+UK_February+9%2C+2023_07.24.csv

	- The data file received from the survey vendor for the UK experiment

- data/Measuring+Multidimensional+Representation+-+Conjoint+DE_February+9%2C+2023_07.49.csv

	- The data file received from the survey vendor for the DE experiment

- data/Measuring+Multidimensional+Representation+-+Conjoint+USA_February+9%2C+2023_06.44

	- The data file received from the survey vendor for the US experiment

- data/uk.xlsx 

	- Survey quota targets for the UK

- data/us.xlsx

	- Survey quota targets for the US

- data/de.xlsx

	- Survey quota targets for DE

- data/Article Codings Countries.xlsx

	- Article codings from literature review reported in appendix

## ADDITIONAL FILES

- code/est_factors_v2.R

	- Estimates factor scores for each dimension on bootstrap-samples of the data

- code/plumber_uk.R

	- Includes texts of the original conjoint levels for the UK experiment

- code/plumber_us.R

	- Includes texts of the original conjoint levels for the US experiment

- code/plumber_de.R

	- Includes texts of the original conjoint levels for the DE experiment


## MANUSCRIPT AND SUPPLEMENTAL INFORMATION

The manuscript and appendix are generated from the following documents.  

- paper/manuscript.tex -- manuscript file
- paper/representation.bib -- bibliography
- paper/conjoint_example.png -- image file used in paper
- paper/chicago-apsr.bst -- LaTeX style file

## SOFTWARE

- R version 4.3.2 (2023-10-31)
- RStudio version 2023.12.1+402

## R PACKAGES

- tidyverse 2.0.0
- readr 2.1.4
- psych 2.3.9
- ggcorrplot 0.1.4.1
- survey 4.2-1
- cregg 0.4.0
- tidycat 0.1.2
- broom 1.0.5
- anesrake 0.80
- logrx 0.3.1
- rsample 1.2.1- tictoc 1.2- furrr 0.3.1

## Operating system

The scripts in this archive were executed using macOS Sonoma v 14.5

